﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using proRFID_DiemDanh.Chung;
using System.Data;
using System.Data.SqlClient;

namespace proRFID_DiemDanh.MonHoc
{
    public class mdMonHoc
    {
        public static DataTable sp_MONHOC_Insert(string TenKhoa)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("sp_MONHOC_Insert", mdMain.cnn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@TenMH", TenKhoa);
            DataTable dt = new DataTable();
            da.Fill(dt);
            return dt;
        }
        public static DataTable sp_MONHOC_Select(int MaMH)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("sp_MONHOC_Select", mdMain.cnn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@MaMH", MaMH);
            DataTable dt = new DataTable();
            da.Fill(dt);
            return dt;
        }
        public static DataTable sp_MONHOC_Update(int MaMH, string TenMH)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("sp_MONHOC_Update", mdMain.cnn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@MaMH", MaMH);
            da.SelectCommand.Parameters.AddWithValue("@TenMH", TenMH);
            DataTable dt = new DataTable();
            da.Fill(dt);
            return dt;
        }
        public static DataTable sp_MONHOC_Delete(int MaMH)
        {
            SqlDataAdapter da = new SqlDataAdapter();
            da.SelectCommand = new SqlCommand("sp_MONHOC_Delete", mdMain.cnn);
            da.SelectCommand.CommandType = CommandType.StoredProcedure;
            da.SelectCommand.Parameters.AddWithValue("@MaMH", MaMH);
            DataTable dt = new DataTable();
            da.Fill(dt);
            return dt;
        }
    }
}